import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import cesium from 'vite-plugin-cesium'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [vue(), cesium()],
  // 反向代理
  server: {
    port: 3001,
    host: "0.0.0.0",
    // 是否自动在浏览器打开
    open: true,
    // 是否开启 https
    https: false,
    proxy: {
      '/api': {
        target: 'http://10.171.16.116:18080',   //代理接口
        // target: 'http://192.168.3.145:18080/api',   //代理接口
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, '')
      },
      '/abs': {
        target: 'http://10.171.16.42:8080',   //代理接口
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/abs/, '')
      }

    },
  },
})
